<!DOCTYPE html>
<html lang="zh">
    <head><meta name="generator" content="Hexo 3.9.0">
    <!-- 
        © Material Theme
        https://github.com/viosey/hexo-theme-material
        Version: 1.3.0 -->

    <!-- Title -->
    
    <title>
        
            Docker on SailfishOS | 
        
        BirdZhang&#39;s Blog
    </title>

    <!-- Favicons -->
    <link rel="icon shortcut" type="image/ico" href="/img/favicon.png">
    <link rel="icon" sizes="192x192" href="/img/favicon.png">
    <link rel="apple-touch-icon" href="/img/favicon.png">

    <!-- Meta & Info -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#0097A7">
    <meta name="author" content="BirdZhang">
    <meta name="description" content="BirdZhang&#39;s GitHub pages powered by Hexo.io and hexo-theme-material.">
    <meta name="keywords" content="null,docker,sailfishos">

    <!--iOS -->
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-title" content="Title">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="480">

    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">

    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="BirdZhang&#39;s Blog">

    <!-- The Open Graph protocol -->
    <meta property="og:url" content="http://birdzhang.xyz">
    <meta property="og:type" content="blog">
    <meta property="og:title" content="Docker on SailfishOS | BirdZhang&#39;s Blog">
    <meta property="og:description" content="BirdZhang&#39;s GitHub pages powered by Hexo.io and hexo-theme-material.">
    <meta property="og:article:tag" content="docker"> <meta property="og:article:tag" content="sailfishos"> 

    <!--[if lte IE 9]>
        <link rel="stylesheet" href="/css/ie-blocker.css">

        
            <script src="/js/ie-blocker.zhCN.js"></script>
        
    <![endif]-->

    <!-- Import CSS -->
    <link rel="stylesheet" href="/css/material.min.css">
    <link rel="stylesheet" href="/css/style.min.css">
    <!-- Config CSS -->


<!-- Other Styles -->
<style>
  body, html {
    font-family: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  }

  a {
    color: #00838F;
  }

  .mdl-card__media,
  #search-label,
  #search-form-label:after,
  #scheme-Paradox .hot_tags-count,
  #scheme-Paradox .sidebar_archives-count,
  #scheme-Paradox .sidebar-colored .sidebar-header,
  #scheme-Paradox .sidebar-colored .sidebar-badge{
    background-color: #0097A7 !important;
  }

  /* Sidebar User Drop Down Menu Text Color */
  #scheme-Paradox .sidebar-colored .sidebar-nav>.dropdown>.dropdown-menu>li>a:hover,
  #scheme-Paradox .sidebar-colored .sidebar-nav>.dropdown>.dropdown-menu>li>a:focus {
    color: #0097A7 !important;
  }

  #post_entry-right-info,
  .sidebar-colored .sidebar-nav li:hover > a,
  .sidebar-colored .sidebar-nav li:hover > a i,
  .sidebar-colored .sidebar-nav li > a:hover,
  .sidebar-colored .sidebar-nav li > a:hover i,
  .sidebar-colored .sidebar-nav li > a:focus i,
  .sidebar-colored .sidebar-nav > .open > a,
  .sidebar-colored .sidebar-nav > .open > a:hover,
  .sidebar-colored .sidebar-nav > .open > a:focus,
  #ds-reset #ds-ctx .ds-ctx-entry .ds-ctx-head a {
    color: #0097A7 !important;
  }

  .toTop {
    background: #757575 !important;
  }

  .material-layout .material-post>.material-nav,
  .material-layout .material-index>.material-nav,
  .material-nav a {
    color: #757575;
  }

  #scheme-Paradox .MD-burger-layer {
    background-color: #757575;
  }

  #scheme-Paradox #post-toc-trigger-btn {
    color: #757575;
  }

  .post-toc a:hover {
    color: #00838F;
    text-decoration: underline;
  }
</style>


<!-- Theme Background Related-->

    <style>
      body{
        background-color: #F5F5F5;
      }

      /* blog_info bottom background */
      #scheme-Paradox .material-layout .something-else .mdl-card__supporting-text{
        background-color: #fff;
      }
    </style>




<!-- Fade Effect -->

    <style>
      .fade {
        transition: all 800ms linear;
        -webkit-transform: translate3d(0,0,0);
        -moz-transform: translate3d(0,0,0);
        -ms-transform: translate3d(0,0,0);
        -o-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
        opacity: 1;
      }

      .fade.out{
        opacity: 0;
      }
    </style>



    <script src="/js/jquery.min.js"></script>
    <script src="/js/queue.js"></script>

    <!-- UC Browser Compatible -->
    <script>
        var agent = navigator.userAgent.toLowerCase();
        if(agent.indexOf('ucbrowser')>0) {
            document.write("<link rel=\"stylesheet\" href=\"/css/uc.css\">");
            alert('由于 UC 浏览器使用极旧的内核，而本网站使用了一些新的特性。\n为了您能更好的浏览，推荐使用 Chrome 或 Firefox 浏览器。');
        }
    </script>

    

    

    <!-- Bing Background -->
    

    <!-- Custom Head -->
    
</head>


    
        <body id="scheme-Paradox" class="lazy">
            <div class="material-layout  mdl-js-layout has-drawer is-upgraded">
                

                <!-- Main Container -->
                <main class="material-layout__content" id="main">

                    <!-- Top Anchor -->
                    <div id="top"></div>

                    
                        <!-- Hamburger Button -->
                        <button class="MD-burger-icon sidebar-toggle">
                            <span class="MD-burger-layer"></span>
                        </button>
                    

                    <!-- Post TOC -->

    
    <!-- Back Button -->
    <!--
    <div class="material-back" id="backhome-div" tabindex="0">
        <a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon"
           href="#" onclick="window.history.back();return false;"
           target="_self"
           role="button"
           data-upgraded=",MaterialButton,MaterialRipple">
            <i class="material-icons" role="presentation">arrow_back</i>
            <span class="mdl-button__ripple-container">
                <span class="mdl-ripple"></span>
            </span>
        </a>
    </div>
    -->

    <!-- Left aligned menu below button -->
    <button id="post-toc-trigger-btn"
        class="mdl-button mdl-js-button mdl-button--icon">
        <i class="material-icons">format_list_numbered</i>
    </button>

    <ul class="post-toc-wrap mdl-menu mdl-menu--bottom-left mdl-js-menu mdl-js-ripple-effect" for="post-toc-trigger-btn">
        <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#How-to-install-Docker-on-SailfishOS-如何将Docker安装到SailfishOS"><span class="post-toc-number">1.</span> <span class="post-toc-text">How to install Docker on SailfishOS/如何将Docker安装到SailfishOS</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Prerequisites-先决条件"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">Prerequisites/先决条件</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Check-Kernel-support-检查内核支持"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">Check Kernel support/检查内核支持</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Download-the-static-binary-archive-下载静态二进制文件"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">Download the static binary archive/下载静态二进制文件</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Add-nemo-to-docker-group-将nemo用户添加到docker组"><span class="post-toc-number">1.4.</span> <span class="post-toc-text">Add nemo to docker group/将nemo用户添加到docker组</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Run-Docker-启动Docker"><span class="post-toc-number">1.5.</span> <span class="post-toc-text">Run Docker/启动Docker</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#Test-network-mapping-测试网络映射"><span class="post-toc-number">1.6.</span> <span class="post-toc-text">Test network mapping /测试网络映射</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#TODO"><span class="post-toc-number">1.7.</span> <span class="post-toc-text">TODO</span></a></li></ol></li></ol>

        <!--
        <li class="mdl-menu__item">
            Some Action
        </li>
        -->
    </ul>




<!-- Layouts -->

    <!-- Post Module -->
    <div class="material-post_container">

        <div class="material-post mdl-grid">
            <div class="mdl-card mdl-shadow--4dp mdl-cell mdl-cell--12-col">

                <!-- Post Header(Thumbnail & Title) -->
                
    <!-- Paradox Post Header -->
    
        
            <!-- Random Thumbnail -->
            <div class="post_thumbnail-random mdl-card__media mdl-color-text--grey-50">
            <script>
    var randomNum = Math.floor(Math.random() * 19 + 1);

    $('.post_thumbnail-random').css('background-image', 'url(' + '/img/random/material-' + randomNum + '.png' + ')');
</script>

        
    
            <p class="article-headline-p">
                Docker on SailfishOS
            </p>
        </div>





                
                    <!-- Paradox Post Info -->
                    <div class="mdl-color-text--grey-700 mdl-card__supporting-text meta">

    <!-- Author Avatar -->
    <div id="author-avatar">
        <img src="/img/avatar.png" width="44px" height="44px" alt="Author Avatar"/>
    </div>
    <!-- Author Name & Date -->
    <div>
        <strong>BirdZhang</strong>
        <span>9月 05, 2018</span>
    </div>

    <div class="section-spacer"></div>

    <!-- Favorite -->
    <!--
        <button id="article-functions-like-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon btn-like">
            <i class="material-icons" role="presentation">favorite</i>
            <span class="visuallyhidden">favorites</span>
        </button>
    -->

    <!-- Qrcode -->
    

    <!-- Tags (bookmark) -->
    
    <button id="article-functions-viewtags-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
        <i class="material-icons" role="presentation">bookmark</i>
        <span class="visuallyhidden">bookmark</span>
    </button>
    <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-functions-viewtags-button">
        <li class="mdl-menu__item">
        <a class="post_tag-link" href="/tags/docker/">docker</a></li><li class="mdl-menu__item"><a class="post_tag-link" href="/tags/sailfishos/">sailfishos</a>
    </ul>
    

    <!-- Share -->
    <button id="article-fuctions-share-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
    <i class="material-icons" role="presentation">share</i>
    <span class="visuallyhidden">share</span>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-fuctions-share-button">
    
    <!-- Leancloud Views -->
        <a class="post_share-link" href="#">
            <li class="mdl-menu__item">
                <span id="/2018/09/05/Docker-on-SailfishOS/" class="leancloud-views_num" data-flag-title="Docker on SailfishOS">
     &nbsp;浏览量
</span>

            </li>
        </a>
    

    

    <!-- Share Weibo -->
    
        <a class="post_share-link" href="http://service.weibo.com/share/share.php?appkey=&title=Docker on SailfishOS&url=http://birdzhang.xyz//2018/09/05/Docker-on-SailfishOS/index.html&pic=&searchPic=false&style=simple" target="_blank">
            <li class="mdl-menu__item">
                分享到微博
            </li>
        </a>
    

    <!-- Share Twitter -->
    
        <a class="post_share-link" href="https://twitter.com/intent/tweet?text=Docker on SailfishOS&url=http://birdzhang.xyz//2018/09/05/Docker-on-SailfishOS/index.html&via=BirdZhang" target="_blank">
            <li class="mdl-menu__item">
                分享到 Twitter
            </li>
        </a>
    

    <!-- Share Facebook -->
    
        <a class="post_share-link" href="https://www.facebook.com/sharer/sharer.php?u=http://birdzhang.xyz//2018/09/05/Docker-on-SailfishOS/index.html" target="_blank">
            <li class="mdl-menu__item">
                分享到 Facebook
            </li>
        </a>
    

    <!-- Share Google+ -->
    
        <a class="post_share-link" href="https://plus.google.com/share?url=http://birdzhang.xyz//2018/09/05/Docker-on-SailfishOS/index.html" target="_blank">
            <li class="mdl-menu__item">
                分享到 Google+
            </li>
        </a>
    

    <!-- Share LinkedIn -->
    

    <!-- Share QQ -->
    

    <!-- Share Telegram -->
    
</ul>

</div>

                

                <!-- Post Content -->
                <div id="post-content" class="mdl-color-text--grey-700 mdl-card__supporting-text fade out">
    
        <h1 id="How-to-install-Docker-on-SailfishOS-如何将Docker安装到SailfishOS"><a href="#How-to-install-Docker-on-SailfishOS-如何将Docker安装到SailfishOS" class="headerlink" title="How to install Docker on SailfishOS/如何将Docker安装到SailfishOS"></a>How to install Docker on SailfishOS/如何将Docker安装到SailfishOS</h1><p>This post will show you how to install Docker on SailfishOS, and some hacks need to do.</p>
<p>这篇文章将介绍如何将Docker安装到SailfishOS上，和需要做的一些hack。</p>
<h2 id="Prerequisites-先决条件"><a href="#Prerequisites-先决条件" class="headerlink" title="Prerequisites/先决条件"></a>Prerequisites/先决条件</h2><p><a href="https://docs.docker.com/install/linux/docker-ce/binaries/#install-daemon-and-client-binaries-on-linux" target="_blank" rel="noopener">https://docs.docker.com/install/linux/docker-ce/binaries/#install-daemon-and-client-binaries-on-linux</a></p>
<ul>
<li>A 64-bit installation</li>
<li>Version 3.10 or higher of the Linux kernel. The latest version of the kernel available for you platform is recommended.</li>
<li>iptables version 1.4 or higher</li>
<li>git version 1.7 or higher</li>
<li>A <code>ps</code> executable, usually provided by <code>procps</code> or a similar package.</li>
<li><a href="http://tukaani.org/xz/" target="_blank" rel="noopener">XZ Utils</a> 4.9 or higher</li>
<li><p>A <a href="https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount" target="_blank" rel="noopener">properly mounted</a> cgroupfs hierarchy; a single, all-encompassing cgroup mount point is not sufficient. See Github issues #2683, #3485, #4568).</p>
</li>
<li><p>64位系统</p>
</li>
<li>3.10内核或更高</li>
<li>iptable版本至少是1.4</li>
<li>git版本至少1.7</li>
<li>可以执行<code>ps</code></li>
<li>xz工具版本至少4.9</li>
<li>正确安装的cgroupfs层次结构; 一个单一的，无所不包的cgroup挂载点是不够的。</li>
</ul>
<h2 id="Check-Kernel-support-检查内核支持"><a href="#Check-Kernel-support-检查内核支持" class="headerlink" title="Check Kernel support/检查内核支持"></a>Check Kernel support/检查内核支持</h2><p>Use this script <a href="https://github.com/moby/moby/raw/master/contrib/check-config.sh" target="_blank" rel="noopener">check-config.sh</a><br>使用这个脚本 <a href="https://github.com/moby/moby/raw/master/contrib/check-config.sh" target="_blank" rel="noopener">check-config.sh</a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br></pre></td><td class="code"><pre><span class="line">[nemo@Sailfish ~]$ ./check-config.sh </span><br><span class="line">info: reading kernel config from /proc/config.gz ...</span><br><span class="line"></span><br><span class="line">Generally Necessary:</span><br><span class="line">- cgroup hierarchy: properly mounted [/sys/fs/cgroup]</span><br><span class="line">- CONFIG_NAMESPACES: enabled</span><br><span class="line">- CONFIG_NET_NS: enabled</span><br><span class="line">- CONFIG_PID_NS: enabled</span><br><span class="line">- CONFIG_IPC_NS: enabled</span><br><span class="line">- CONFIG_UTS_NS: enabled</span><br><span class="line">- CONFIG_CGROUPS: enabled</span><br><span class="line">- CONFIG_CGROUP_CPUACCT: enabled</span><br><span class="line">- CONFIG_CGROUP_DEVICE: enabled</span><br><span class="line">- CONFIG_CGROUP_FREEZER: enabled</span><br><span class="line">- CONFIG_CGROUP_SCHED: enabled</span><br><span class="line">- CONFIG_CPUSETS: enabled</span><br><span class="line">- CONFIG_MEMCG: enabled</span><br><span class="line">- CONFIG_KEYS: enabled</span><br><span class="line">- CONFIG_VETH: enabled</span><br><span class="line">- CONFIG_BRIDGE: enabled</span><br><span class="line">- CONFIG_BRIDGE_NETFILTER: enabled (as module)</span><br><span class="line">- CONFIG_NF_NAT_IPV4: enabled</span><br><span class="line">- CONFIG_IP_NF_FILTER: enabled</span><br><span class="line">- CONFIG_IP_NF_TARGET_MASQUERADE: enabled</span><br><span class="line">- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled</span><br><span class="line">- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled</span><br><span class="line">- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled</span><br><span class="line">- CONFIG_IP_NF_NAT: enabled</span><br><span class="line">- CONFIG_NF_NAT: enabled</span><br><span class="line">- CONFIG_NF_NAT_NEEDED: enabled</span><br><span class="line">- CONFIG_POSIX_MQUEUE: enabled</span><br><span class="line">- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled</span><br><span class="line"></span><br><span class="line">Optional Features:</span><br><span class="line">- CONFIG_USER_NS: enabled</span><br><span class="line">- CONFIG_SECCOMP: enabled</span><br><span class="line">- CONFIG_CGROUP_PIDS: missing</span><br><span class="line">- CONFIG_MEMCG_SWAP: enabled</span><br><span class="line">- CONFIG_MEMCG_SWAP_ENABLED: enabled</span><br><span class="line">    (cgroup swap accounting is currently enabled)</span><br><span class="line">- CONFIG_MEMCG_KMEM: enabled</span><br><span class="line">- CONFIG_RESOURCE_COUNTERS: enabled</span><br><span class="line">- CONFIG_BLK_CGROUP: enabled</span><br><span class="line">- CONFIG_BLK_DEV_THROTTLING: missing</span><br><span class="line">- CONFIG_IOSCHED_CFQ: enabled</span><br><span class="line">- CONFIG_CFQ_GROUP_IOSCHED: missing</span><br><span class="line">- CONFIG_CGROUP_PERF: enabled</span><br><span class="line">- CONFIG_CGROUP_HUGETLB: missing</span><br><span class="line">- CONFIG_NET_CLS_CGROUP: enabled</span><br><span class="line">- CONFIG_CGROUP_NET_PRIO: enabled</span><br><span class="line">- CONFIG_CFS_BANDWIDTH: missing</span><br><span class="line">- CONFIG_FAIR_GROUP_SCHED: enabled</span><br><span class="line">- CONFIG_RT_GROUP_SCHED: enabled</span><br><span class="line">- CONFIG_IP_VS: enabled</span><br><span class="line">- CONFIG_IP_VS_NFCT: enabled</span><br><span class="line">- CONFIG_IP_VS_RR: enabled</span><br><span class="line">- CONFIG_EXT3_FS: enabled</span><br><span class="line">- CONFIG_EXT3_FS_XATTR: enabled</span><br><span class="line">- CONFIG_EXT3_FS_POSIX_ACL: enabled</span><br><span class="line">- CONFIG_EXT3_FS_SECURITY: enabled</span><br><span class="line">- CONFIG_EXT4_FS: enabled</span><br><span class="line">- CONFIG_EXT4_FS_POSIX_ACL: missing</span><br><span class="line">- CONFIG_EXT4_FS_SECURITY: enabled</span><br><span class="line">    enable these ext4 configs if you are using ext4 as backing filesystem</span><br><span class="line">- Network Drivers:</span><br><span class="line">  - &quot;overlay&quot;:</span><br><span class="line">    - CONFIG_VXLAN: enabled</span><br><span class="line">      Optional (for encrypted networks):</span><br><span class="line">      - CONFIG_CRYPTO: enabled</span><br><span class="line">      - CONFIG_CRYPTO_AEAD: enabled</span><br><span class="line">      - CONFIG_CRYPTO_GCM: enabled</span><br><span class="line">      - CONFIG_CRYPTO_SEQIV: enabled</span><br><span class="line">      - CONFIG_CRYPTO_GHASH: enabled</span><br><span class="line">      - CONFIG_XFRM: enabled</span><br><span class="line">      - CONFIG_XFRM_USER: enabled</span><br><span class="line">      - CONFIG_XFRM_ALGO: enabled</span><br><span class="line">      - CONFIG_INET_ESP: enabled</span><br><span class="line">      - CONFIG_INET_XFRM_MODE_TRANSPORT: enabled</span><br><span class="line">  - &quot;ipvlan&quot;:</span><br><span class="line">    - CONFIG_IPVLAN: missing</span><br><span class="line">  - &quot;macvlan&quot;:</span><br><span class="line">    - CONFIG_MACVLAN: enabled</span><br><span class="line">    - CONFIG_DUMMY: missing</span><br><span class="line">  - &quot;ftp,tftp client in container&quot;:</span><br><span class="line">    - CONFIG_NF_NAT_FTP: enabled</span><br><span class="line">    - CONFIG_NF_CONNTRACK_FTP: enabled</span><br><span class="line">    - CONFIG_NF_NAT_TFTP: enabled</span><br><span class="line">    - CONFIG_NF_CONNTRACK_TFTP: enabled</span><br><span class="line">- Storage Drivers:</span><br><span class="line">  - &quot;aufs&quot;:</span><br><span class="line">    - CONFIG_AUFS_FS: missing</span><br><span class="line">  - &quot;btrfs&quot;:</span><br><span class="line">    - CONFIG_BTRFS_FS: enabled</span><br><span class="line">    - CONFIG_BTRFS_FS_POSIX_ACL: enabled</span><br><span class="line">  - &quot;devicemapper&quot;:</span><br><span class="line">    - CONFIG_BLK_DEV_DM: enabled</span><br><span class="line">    - CONFIG_DM_THIN_PROVISIONING: missing</span><br><span class="line">  - &quot;overlay&quot;:</span><br><span class="line">    - CONFIG_OVERLAY_FS: enabled</span><br><span class="line">  - &quot;zfs&quot;:</span><br><span class="line">    - /dev/zfs: missing</span><br><span class="line">    - zfs command: missing</span><br><span class="line">    - zpool command: missing</span><br><span class="line"></span><br><span class="line">Limits:</span><br><span class="line">- /proc/sys/kernel/keys/root_maxkeys: 1000000</span><br><span class="line"></span><br><span class="line">[nemo@Sailfish ~]$</span><br></pre></td></tr></table></figure>
<p>Generally Necessary must be all <code>enabled</code>, if not enabled, you must enable it in your kernel defconfig, and rebuild kernel.<br>Generally Necessary 部分必须全部是<code>enabled</code>, 如果没有启用，必须启用然后重启编译内核。</p>
<h2 id="Download-the-static-binary-archive-下载静态二进制文件"><a href="#Download-the-static-binary-archive-下载静态二进制文件" class="headerlink" title="Download the static binary archive/下载静态二进制文件"></a>Download the static binary archive/下载静态二进制文件</h2><p><a href="https://download.docker.com/linux/static/stable/aarch64/" target="_blank" rel="noopener">https://download.docker.com/linux/static/stable/aarch64/</a></p>
<p>Extract the archive and put them to <code>/usr/bin/</code></p>
<h2 id="Add-nemo-to-docker-group-将nemo用户添加到docker组"><a href="#Add-nemo-to-docker-group-将nemo用户添加到docker组" class="headerlink" title="Add nemo to docker group/将nemo用户添加到docker组"></a>Add nemo to docker group/将nemo用户添加到docker组</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">groupadd docker</span><br><span class="line">usermod -a -G docker nemo</span><br></pre></td></tr></table></figure>
<h2 id="Run-Docker-启动Docker"><a href="#Run-Docker-启动Docker" class="headerlink" title="Run Docker/启动Docker"></a>Run Docker/启动Docker</h2><p>Start docker daemon/ 启动docker守护进程<br><code>devel-su /usr/bin/dockerd</code></p>
<p>Or use systemd/ 或者使用systemd</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">[Unit]</span><br><span class="line">Description=Docker Application Container Engine</span><br><span class="line">Documentation=https://docs.docker.com</span><br><span class="line">After=network-online.target firewalld.service</span><br><span class="line">Wants=network-online.target</span><br><span class="line"></span><br><span class="line">[Service]</span><br><span class="line">Type=notify</span><br><span class="line">ExecStart=/usr/bin/dockerd</span><br><span class="line">ExecReload=/bin/kill -s HUP $MAINPID</span><br><span class="line">LimitNOFILE=infinity</span><br><span class="line">LimitNPROC=infinity</span><br><span class="line">LimitCORE=infinity</span><br><span class="line">TimeoutStartSec=0</span><br><span class="line">KillMode=process</span><br><span class="line">Restart=on-failure</span><br><span class="line">StartLimitBurst=3</span><br><span class="line">StartLimitInterval=60s</span><br><span class="line"></span><br><span class="line">[Install]</span><br><span class="line">WantedBy=multi-user.target</span><br></pre></td></tr></table></figure>
<p>Check version/检查版本<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">[root@Sailfish nemo]# docker version</span><br><span class="line"></span><br><span class="line">Client:</span><br><span class="line"> Version:           18.06.1-ce</span><br><span class="line"> API version:       1.38</span><br><span class="line"> Go version:        go1.10.3</span><br><span class="line"> Git commit:        e68fc7a</span><br><span class="line"> Built:             Tue Aug 21 17:20:38 2018</span><br><span class="line"> OS/Arch:           linux/arm64</span><br><span class="line"> Experimental:      false</span><br><span class="line"></span><br><span class="line">Server:</span><br><span class="line"> Engine:</span><br><span class="line">  Version:          18.06.1-ce</span><br><span class="line">  API version:      1.38 (minimum version 1.12)</span><br><span class="line">  Go version:       go1.10.3</span><br><span class="line">  Git commit:       e68fc7a</span><br><span class="line">  Built:            Tue Aug 21 17:27:20 2018</span><br><span class="line">  OS/Arch:          linux/arm64</span><br><span class="line">  Experimental:     false</span><br></pre></td></tr></table></figure></p>
<p>Test/测试<br><code>devel-su docker run hello-world</code> </p>
<p>This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits. / 这个命令会下载一个测试镜像，如果执行成功会打印如下信息</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">[root@Sailfish nemo]# docker run hello-world</span><br><span class="line">Unable to find image &apos;hello-world:latest&apos; locally</span><br><span class="line">latest: Pulling from library/hello-world</span><br><span class="line">255483503861: Pull complete </span><br><span class="line">Digest: sha256:4b8ff392a12ed9ea17784bd3c9a8b1fa3299cac44aca35a85c90c5e3c7afacdc</span><br><span class="line">Status: Downloaded newer image for hello-world:latest</span><br><span class="line"></span><br><span class="line">Hello from Docker!</span><br><span class="line">This message shows that your installation appears to be working correctly.</span><br><span class="line"></span><br><span class="line">To generate this message, Docker took the following steps:</span><br><span class="line"> 1. The Docker client contacted the Docker daemon.</span><br><span class="line"> 2. The Docker daemon pulled the &quot;hello-world&quot; image from the Docker Hub.</span><br><span class="line">    (arm64v8)</span><br><span class="line"> 3. The Docker daemon created a new container from that image which runs the</span><br><span class="line">    executable that produces the output you are currently reading.</span><br><span class="line"> 4. The Docker daemon streamed that output to the Docker client, which sent it</span><br><span class="line">    to your terminal.</span><br><span class="line"></span><br><span class="line">To try something more ambitious, you can run an Ubuntu container with:</span><br><span class="line"> $ docker run -it ubuntu bash</span><br><span class="line"></span><br><span class="line">Share images, automate workflows, and more with a free Docker ID:</span><br><span class="line"> https://hub.docker.com/</span><br><span class="line"></span><br><span class="line">For more examples and ideas, visit:</span><br><span class="line"> https://docs.docker.com/engine/userguide/</span><br></pre></td></tr></table></figure>
<h2 id="Test-network-mapping-测试网络映射"><a href="#Test-network-mapping-测试网络映射" class="headerlink" title="Test network mapping /测试网络映射"></a>Test network mapping /测试网络映射</h2><p>On one terminal/在一个终端中执行<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@Sailfish nemo]# docker run -it --rm -p 6080:80 nginx:latest        </span><br><span class="line">172.17.0.1 - - [05/Sep/2018:08:54:52 +0000] &quot;GET / HTTP/1.1&quot; 200 612 &quot;-&quot; &quot;curl/7.58.0-DEV&quot; &quot;-&quot;</span><br><span class="line">172.17.0.1 - - [05/Sep/2018:08:55:51 +0000] &quot;GET / HTTP/1.1&quot; 200 612 &quot;-&quot; &quot;curl/7.58.0-DEV&quot; &quot;-&quot;</span><br></pre></td></tr></table></figure></p>
<p>Vist on another terminal/在另一个终端中访问<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">[nemo@Sailfish ~]$ curl -s 127.0.0.1:6080</span><br><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">&lt;title&gt;Welcome to nginx!&lt;/title&gt;</span><br><span class="line">&lt;style&gt;</span><br><span class="line">    body &#123;</span><br><span class="line">        width: 35em;</span><br><span class="line">        margin: 0 auto;</span><br><span class="line">        font-family: Tahoma, Verdana, Arial, sans-serif;</span><br><span class="line">    &#125;</span><br><span class="line">&lt;/style&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;</span><br><span class="line">&lt;p&gt;If you see this page, the nginx web server is successfully installed and</span><br><span class="line">working. Further configuration is required.&lt;/p&gt;</span><br><span class="line"></span><br><span class="line">&lt;p&gt;For online documentation and support please refer to</span><br><span class="line">&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;</span><br><span class="line">Commercial support is available at</span><br><span class="line">&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;</span><br><span class="line"></span><br><span class="line">&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br><span class="line">[nemo@Sailfish ~]$</span><br></pre></td></tr></table></figure></p>
<h2 id="TODO"><a href="#TODO" class="headerlink" title="TODO"></a>TODO</h2><p>Wayland forward /wayland转发</p>
<p>Reference/参考:</p>
<ul>
<li><a href="https://unix.stackexchange.com/questions/330366/how-can-i-run-a-graphical-application-in-a-container-under-wayland" target="_blank" rel="noopener">https://unix.stackexchange.com/questions/330366/how-can-i-run-a-graphical-application-in-a-container-under-wayland</a></li>
<li><a href="http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/" target="_blank" rel="noopener">http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/</a></li>
</ul>
<p>Have fun ;)</p>

    

    
</div>


                

                <!-- Post Comments -->
                
                    


    <!-- 使用 DISQUS -->
    <div id="disqus-comment">
        <div id="disqus_thread"></div>
<script>
    queue.offer(function() {
            var disqus_config = function () {
                this.page.url = 'http://birdzhang.xyz/2018/09/05/Docker-on-SailfishOS/index.html';  // Replace PAGE_URL with your page's canonical URL variable
                this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
            };

            (function() { // DON'T EDIT BELOW THIS LINE
                var d = document;
                var s = d.createElement('script');
                s.src = '//0312birdzhang-github-io.disqus.com/embed.js';
                s.setAttribute('data-timestamp', + new Date());
                (d.head || d.body).appendChild(s);
            })();
        });
</script>

    </div>
    <style>
        #disqus-comment{
            background-color: #eee;
            padding: 2pc;
        }
    </style>



                
            </div>

            <!-- Post Prev & Next Nav -->
            <nav class="material-nav mdl-color-text--grey-50 mdl-cell mdl-cell--12-col">
    <!-- Prev Nav -->
    
        <a href="/2018/09/12/Nginx获取用户真实IP/" id="post_nav-newer" class="prev-content">
            <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
                <i class="material-icons">arrow_back</i>
            </button>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            新篇
        </a>
    

    <!-- Section Spacer -->
    <div class="section-spacer"></div>

    <!-- Next Nav -->
    
        <a href="/2018/08/09/从iOS迁移到SailfishOS计划/" id="post_nav-older" class="next-content">
            旧篇
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
                <i class="material-icons">arrow_forward</i>
            </button>
        </a>
    
</nav>

        </div>
    </div>



                    
                        <!-- Overlay For Active Sidebar -->
<div class="sidebar-overlay"></div>

<!-- Material sidebar -->
<aside id="sidebar" class="sidebar sidebar-colored sidebar-fixed-left" role="navigation">
    <div id="sidebar-main">
        <!-- Sidebar Header -->
        <div class="sidebar-header header-cover" style="background-image: url(/img/sidebar_header.png);">
    <!-- Top bar -->
    <div class="top-bar"></div>

    <!-- Sidebar toggle button -->
    <button type="button" class="sidebar-toggle mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon" style="display: initial;" data-upgraded=",MaterialButton,MaterialRipple">
        <i class="material-icons">clear_all</i>
        <span class="mdl-button__ripple-container">
            <span class="mdl-ripple">
            </span>
        </span>
    </button>

    <!-- Sidebar Avatar -->
    <div class="sidebar-image">
        <img src="/img/avatar.png" alt="BirdZhang's avatar">
    </div>

    <!-- Sidebar Email -->
    <a data-toggle="dropdown" class="sidebar-brand" href="#settings-dropdown">
        0312birdzhang@email.com
        <b class="caret"></b>
    </a>
</div>


        <!-- Sidebar Navigation  -->
        <ul class="nav sidebar-nav">
    <!-- User dropdown  -->
    <li class="dropdown">
        <ul id="settings-dropdown" class="dropdown-menu">
            
                <li>
                    <a href="mailto:0312birdzhang@gmail.com" target="_blank" title="Email Me">
                        
                            <i class="material-icons sidebar-material-icons sidebar-indent-left1pc-element">email</i>
                        
                        Email Me
                    </a>
                </li>
            
        </ul>
    </li>

    <!-- Homepage -->
    
        <li id="sidebar-first-li">
            <a href="/" target="_self">
                
                    <i class="material-icons sidebar-material-icons">home</i>
                
                主页
            </a>
        </li>
        
    

    <!-- Archives  -->
    
        <li class="dropdown">
            <a href="#" class="ripple-effect dropdown-toggle" data-toggle="dropdown">
                
                    <i class="material-icons sidebar-material-icons">inbox</i>
                
                    归档
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
            <li>
                <a class="sidebar_archives-link" href="/archives/2019/07/">七月 2019<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2019/06/">六月 2019<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2019/05/">五月 2019<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2019/04/">四月 2019<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/12/">十二月 2018<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/09/">九月 2018<span class="sidebar_archives-count">2</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/08/">八月 2018<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/07/">七月 2018<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/06/">六月 2018<span class="sidebar_archives-count">3</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/05/">五月 2018<span class="sidebar_archives-count">2</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/03/">三月 2018<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2018/01/">一月 2018<span class="sidebar_archives-count">2</span></a></li><li><a class="sidebar_archives-link" href="/archives/2017/12/">十二月 2017<span class="sidebar_archives-count">3</span></a></li><li><a class="sidebar_archives-link" href="/archives/2017/08/">八月 2017<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2017/06/">六月 2017<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/archives/2017/05/">五月 2017<span class="sidebar_archives-count">8</span></a>
            </ul>
        </li>
        
    

    <!-- Categories  -->
    

    <!-- Pages  -->
    
        <li>
            <a href="/links/" title="友情链接">
                
                    <i class="material-icons sidebar-material-icons">link</i>
                
                友情链接
            </a>
        </li>
        
    
        <li>
            <a href="/about" title="关于我">
                
                    <i class="material-icons sidebar-material-icons">person</i>
                
                关于我
            </a>
        </li>
        
    
        <li>
            <a href="/tags" title="标签">
                
                    <i class="material-icons sidebar-material-icons">bookmark</i>
                
                标签
            </a>
        </li>
        
    

    <!-- Article Number  -->
    
</ul>


        <!-- Sidebar Footer -->
        <!--
I'm glad you use this theme, the development is no so easy, I hope you can keep the copyright, I will thank you so much.
If you still want to delete the copyrights, could you still retain the first one? Which namely "Theme Material"
It will not impact the appearance and can give developers a lot of support :)

很高兴您使用并喜欢该主题，开发不易 十分谢谢与希望您可以保留一下版权声明。
如果您仍然想删除的话 能否只保留第一项呢？即 "Theme Material"
它不会影响美观并可以给开发者很大的支持和动力。 :)
-->

<!-- Sidebar Divider -->

    <div class="sidebar-divider"></div>


<!-- Theme Material -->

    <a href="https://github.com/viosey/hexo-theme-material"  class="sidebar-footer-text-a" target="_blank">
        <div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
            主题 - Material
            <span class="sidebar-badge badge-circle">i</span>
        </div>
    </a>


<!-- Help & Support -->
<!--

-->

<!-- Feedback -->
<!--

-->

<!-- About Theme -->
<!--

-->

    </div>

    <!-- Sidebar Image -->
    

</aside>

                    

                    
                        <!-- Footer Top Button -->
                        <div class="toTop-wrap">
    <a href="#top" class="toTop">
        <i class="material-icons footer_top-i">expand_less</i>
    </a>
</div>

                    

                    <!--Footer-->
<footer class="mdl-mini-footer" id="bottom">
    
        <!-- Paradox Footer Left Section -->
        <div class="mdl-mini-footer--left-section sns-list">
    <!-- Twitter -->
    
        <a href="https://twitter.com/0312birdzhang" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn" style="background-image: url(/img/footer/footer_ico-twitter.png);">
                <span class="visuallyhidden">Twitter</span>
            </button><!--
     --></a>
    

    <!-- Facebook -->
    

    <!-- Google + -->
    
        <a href="https://www.google.com/0312birdzhang" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn" style="background-image: url(/img/footer/footer_ico-gplus.png);">
                <span class="visuallyhidden">Google Plus</span>
            </button><!--
     --></a>
    

    <!-- Weibo -->
    
        <a href="http://weibo.com/0312birdzhang" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn" style="background-image: url(/img/footer/footer_ico-weibo.png);">
                <span class="visuallyhidden">Weibo</span>
            </button><!--
     --></a>
    

    <!-- Instagram -->
    

    <!-- Tumblr -->
    

    <!-- Github -->
    
        <a href="https://github.com/0312birdzhang" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn" style="background-image: url(/img/footer/footer_ico-github.png);">
                <span class="visuallyhidden">Github</span>
            </button><!--
     --></a>
    

    <!-- LinkedIn -->
    

    <!-- Zhihu -->
    

    <!-- Bilibili -->
    

    <!-- Telegram -->
    
</div>


        <!--Copyright-->
        <div id="copyright">
            Copyright&nbsp;©&nbsp;
            <script type="text/javascript">
                var fd = new Date();
                document.write(fd.getFullYear());
            </script>
            &nbsp;BirdZhang's Blog
        </div>

        <!-- Paradox Footer Right Section -->

        <!--
        I am glad you use this theme, the development is no so easy, I hope you can keep the copyright.
        It will not impact the appearance and can give developers a lot of support :)

        很高兴您使用该主题，开发不易，希望您可以保留一下版权声明。
        它不会影响美观并可以给开发者很大的支持。 :)
        -->

        <div class="mdl-mini-footer--right-section">
            <div>
                <div class="footer-develop-div">Powered by <a href="https://hexo.io" target="_blank" class="footer-develop-a">Hexo</a></div>
                <div class="footer-develop-div">Theme - <a href="https://github.com/viosey/hexo-theme-material" target="_blank" class="footer-develop-a">Material</a></div>
            </div>
        </div>
    
</footer>


                    <!-- Import File -->
<script src="/js/lazyload.min.js"></script>
<script src="/js/js.min.js"></script>
<script src="/js/nprogress.js"></script>

<script type="text/javascript">
    NProgress.configure({
        showSpinner: true
    });
    NProgress.start();
    $('#nprogress .bar').css({
        'background': '#29d'
    });
    $('#nprogress .peg').css({
        'box-shadow': '0 0 10px #29d, 0 0 15px #29d'
    });
    $('#nprogress .spinner-icon').css({
        'border-top-color': '#29d',
        'border-left-color': '#29d'
    });
    setTimeout(function() {
        NProgress.done();
        $('.fade').removeClass('out');
    }, 800);
</script>





    <!-- Leancloud -->
    <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
    <script>
        AV.initialize('MguK71QUSGyrb4biWtu5oPqN-gzGzoHsz', 'ghPhHxzVQtKRfKt72twwiUFx');
    </script>
    <script>
    function showTime(Counter) {
        var query = new AV.Query(Counter);
        $('.leancloud-views_num').each(function() {
            var url = $(this).attr('id').trim();
            query.equalTo('url', url);
            query.find({
                success: function(results) {
                    if (results.length === 0) {
                        var content = '0 ' + $(document.getElementById(url)).text();
                        $(document.getElementById(url)).text(content);
                        return;
                    }
                    for (var i = 0; i < results.length; i++) {
                        var object = results[i];
                        var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
                        $(document.getElementById(url)).text(content);
                    }
                },
                error: function(object, error) {
                    console.log('Error: ' + error.code + ' ' + error.message);
                }
            });
        });
    }

    function addCount(Counter) {
      var Counter = AV.Object.extend('Counter');
      url = $('.leancloud-views_num').attr('id').trim();
      title = $('.leancloud-views_num').attr('data-flag-title').trim();
      var query = new AV.Query(Counter);
      query.equalTo('url', url);
      query.find({
          success: function(results) {
            if (results.length > 0) {
                var counter = results[0];
                counter.fetchWhenSave(true);
                counter.increment('time');
                counter.save(null, {
                    success: function(counter) {
                        var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
                        $(document.getElementById(url)).text(content);
                    },
                    error: function(counter, error) {
                        console.log('Failed to save Visitor num, with error message: ' + error.message);
                    }
                });
            } else {
              var newcounter = new Counter();
              newcounter.set('title', title);
              newcounter.set('url', url);
              newcounter.set('time', 1);
              newcounter.save(null, {
                  success: function(newcounter) {
                      console.log('newcounter.get(\'time\')='+newcounter.get('time'));
                      var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
                      $(document.getElementById(url)).text(content);
                  },
                  error: function(newcounter, error) {
                      console.log('Failed to create');
                  }
              });
            }
        },
        error: function(error) {
            console.log('Error:' + error.code + ' ' + error.message);
        }
      });
    }
    $(function() {
        var Counter = AV.Object.extend('Counter');
        if ($('.leancloud-views_num').length === 1) {
            addCount(Counter);
        } else if ($('.post-title-link').length > 1) {
            showTime(Counter);
        }
    });
</script>








    <!-- 使用 DISQUS js 代码 -->
    <script id="dsq-count-scr" src="//0312birdzhang-github-io.disqus.com/count.js" async></script>



<!-- Swiftye -->


<!-- Local Search-->


<!-- Window Load-->
<script>
    $(window).load(function() {
        // Post_Toc parent position fixed
        $('.post-toc-wrap').parent('.mdl-menu__container').css('position', 'fixed');
    });
</script>

<!-- MathJax Load-->


                </main>
            </div>
        </body>
    
</html>
